package com.gosophia.conference.action.common;

import java.util.Collections;
import java.util.List;

import net.sf.json.JSONArray;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.gosophia.commons.web.action.BaseSupportAction;
import com.gosophia.dataDictionary.dto.DataValueDTO;
import com.gosophia.dataDictionary.ws.DataDictionaryWebService;

@Scope("prototype")
@Controller("ToConferenceQueryPageAction")
public class ToConferenceQueryPageAction extends BaseSupportAction{
    
    private static final long serialVersionUID = 1L;

    @Autowired
    private DataDictionaryWebService dataDictionaryWebService;
    
    private String importanceString ;
    
    private static final Long IMPORTANCE_ENTRYID = 1014L;
    @Override
    public String _execute() throws Exception {
      //获取重要程度列表
        List<DataValueDTO> importanceList = dataDictionaryWebService.findEnabledDataValueByEntryId(IMPORTANCE_ENTRYID);
        if(importanceList!=null){
            Collections.reverse(importanceList);
            importanceString = JSONArray.fromObject(importanceList).toString().replace("\"", "\\\"");
        }
        return SUCCESS;
    }
    public String getImportanceString() {
        return importanceString;
    }
    public void setImportanceString(String importanceString) {
        this.importanceString = importanceString;
    }
    
}
